package mutsumimod.cards.custom;

import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import mutsumimod.actions.SecretAction;
import mutsumimod.cards.BaseCard;
import mutsumimod.character.Mutsumi;
import mutsumimod.util.CardStats;

import java.util.ArrayList;

public class KeepSecret extends BaseCard {
    public static final String ID = makeID(KeepSecret.class.getSimpleName());
    public static final CardStats info = new CardStats(
            Mutsumi.Meta.CARD_COLOR,
            CardType.SKILL,
            CardRarity.UNCOMMON,
            CardTarget.SELF,
            -2
    );

    public KeepSecret() {
        super(ID, info);
        setAttr(0,0,2);
        setAttrUpg(0,0,1);
    }

    @Override
    public boolean canUse(AbstractPlayer p, AbstractMonster m){
        if(getInCopyUse()){
            return super.canUse(p, m);
        }else{
            return false;
        }
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
    }

    @Override
    public void onCopyChooseThisCard(ArrayList<AbstractCard> cards) {
        gainEnergy();
        addToBot(new SecretAction(this));
    }

    @Override
    public AbstractCard makeCopy() { //Optional
        return new KeepSecret();
    }

    @Override
    public void updateDescription() {
        if(getInCopyUse()){
            if(upgraded){
                this.rawDescription=cardStrings.EXTENDED_DESCRIPTION[1];
            }else{
                this.rawDescription=cardStrings.EXTENDED_DESCRIPTION[0];
            }
        }else{
            if(upgraded){
                this.rawDescription=cardStrings.UPGRADE_DESCRIPTION;
            }else{
                this.rawDescription=cardStrings.DESCRIPTION;
            }
        }
        initializeDescription();
    }

}
